<html>
<head>
<h1>Delete Faculty</h1>
</head>

<body>
<form action="delfaculty.php" method="GET">
Faculty Id: <input type='text' name = 'fid' /> <br/>
<input type='submit' name = 'Delete' value='Delete'/>
</form>
</body>

<?php
	require "config.php";
	error_reporting(0);
	
	$fid = $_GET['fid'];
	
	
	$con = mysql_connect("localhost",$db_user ,$db_pass);

	// if an error was encountered, the script exits with an error message
	if (!$con){
		die('Could not connect: ' . mysql_error());
    }
	//after successfully connecting with the database server, select the database with which you want to communicate
	mysql_select_db($db_name, $con);
	$sql_del = "DELETE FROM faculty WHERE facultyId = '$fid'";
	
	$result1 = mysql_query($sql_del);
	mysql_close($con);
?>
<br />
<a href="student.php">Home</a>
</html>
